package cn.faster.sys.service.impl;

import cn.faster.sys.entity.SysRoleMenuCenter;
import cn.faster.sys.mapper.SysRoleMenuCenterMapper;
import cn.faster.sys.service.SysRoleMenuCenterService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 角色权限中间表 服务实现类
 * </p>
 *
 * @author xiaoCoder
 * @since 2021-06-10
 */
@Slf4j
@Service
@AllArgsConstructor
public class SysRoleMenuCenterServiceImpl extends ServiceImpl<SysRoleMenuCenterMapper, SysRoleMenuCenter> implements SysRoleMenuCenterService {


    private final SysRoleMenuCenterMapper sysRoleMenuCenterMapper;

    /**
	* 根据id查询RoleMenuCenter
	*/
    @Override
    public SysRoleMenuCenter getRoleMenuCenterById(Long id) throws Exception {
        return sysRoleMenuCenterMapper.getRoleMenuCenterById(id);
    }

    /**
	* 查询RoleMenuCenter列表
	*/
    @Override
    public List<SysRoleMenuCenter> listRoleMenuCenter(Map<String, Object> map) throws Exception {
        return sysRoleMenuCenterMapper.listRoleMenuCenter(map);
    }



    /**
	* 新增RoleMenuCenter
	*/
    @Override
    @Transactional
    public Integer addRoleMenuCenter(SysRoleMenuCenter sysRoleMenuCenter) throws Exception {
        return sysRoleMenuCenterMapper.addRoleMenuCenter(sysRoleMenuCenter);
    }

    /**
	* 更新RoleMenuCenter
	*/
    @Override
    @Transactional
    public Integer updateRoleMenuCenter(SysRoleMenuCenter sysRoleMenuCenter) throws Exception {
        return sysRoleMenuCenterMapper.updateRoleMenuCenter(sysRoleMenuCenter);
    }

   	/**
	* 根据id删除RoleMenuCenter
	*/
    @Override
    @Transactional
	public Integer deleteRoleMenuCenterById(Integer id) throws Exception {
        return sysRoleMenuCenterMapper.deleteRoleMenuCenterById(id);
    }

	/**
	* 根据id逻辑删除RoleMenuCenter
	*/
    @Override
    @Transactional
	public Integer removeRoleMenuCenterById(Integer id) throws Exception {
        return sysRoleMenuCenterMapper.removeRoleMenuCenterById(id);
    }
}
